<?php

/**
 * sfGuardUserProfile form base class.
 *
 * @method sfGuardUserProfile getObject() Returns the current form's model object
 *
 * @package    KrazyTaxi
 * @subpackage form
 * @author     Your name here
 */
abstract class BasesfGuardUserProfileForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IDUSUARIO'           => new sfWidgetFormInputHidden(),
      'user_id'             => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => false)),
      'IDCOMUNA'            => new sfWidgetFormPropelChoice(array('model' => 'Comuna', 'add_empty' => true)),
      'RUTUSUARIO'          => new sfWidgetFormInputText(),
      'EMAILUSUARIO'        => new sfWidgetFormInputText(),
      'NOMBREUSUARIO'       => new sfWidgetFormInputText(),
      'APELLIDOPATUSUARIO'  => new sfWidgetFormInputText(),
      'APELLIDOMATUSUARIO'  => new sfWidgetFormInputText(),
      'FECHAINGRESOUSUARIO' => new sfWidgetFormDate(),
    ));

    $this->setValidators(array(
      'IDUSUARIO'           => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdusuario()), 'empty_value' => $this->getObject()->getIdusuario(), 'required' => false)),
      'user_id'             => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
      'IDCOMUNA'            => new sfValidatorPropelChoice(array('model' => 'Comuna', 'column' => 'IDCOMUNA', 'required' => false)),
      'RUTUSUARIO'          => new sfValidatorString(array('max_length' => 10)),
      'EMAILUSUARIO'        => new sfValidatorString(array('max_length' => 40)),
      'NOMBREUSUARIO'       => new sfValidatorString(array('max_length' => 20)),
      'APELLIDOPATUSUARIO'  => new sfValidatorString(array('max_length' => 20)),
      'APELLIDOMATUSUARIO'  => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'FECHAINGRESOUSUARIO' => new sfValidatorDate(),
    ));

    $this->widgetSchema->setNameFormat('sf_guard_user_profile[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'sfGuardUserProfile';
  }


}
